<?php 
if ($this->pageCount) {
    // you need to add each of the request parameters to url
    $params = Zend_Controller_Front::getInstance()->getRequest()->getParams();
    // remove the system parameters
    unset($params['module']);
    unset($params['controller']);
    unset($params['action']);
    unset($params['lang']);
    
    $pageName = $this->pagename?$this->pagename:'page';
    ?>

<?php
    if (isset($this->previous)) {
        ?>
  <a title="previous" 
	href="<?php
        echo $this->url(array_merge($params, array($pageName => $this->previous)));
        ?>"> <img alt="previous" src="<?=$this->applicationUrl()?>/public/images/ico_arrow_prev.gif"> </a>
<?php
    } 
    else 
    {
    ?>
    	<img alt="previous" src="<?=$this->applicationUrl()?>/public/images/ico_arrow_prev_end.gif">
    <?php	
    }
    ?>

<!-- Numbered page links -->
<?php
    foreach ($this->pagesInRange as $page) {
        ?>
  <?php
        if ($page != $this->current) {
            ?>
    <a
	href="<?php
            echo $this->url(array_merge($params, array($pageName => $page)));
            ?>">
        <?php
            echo $page;
            ?>
    </a> 
  <?php
  			if ($this->lastPageInRange != $page)
            	echo " | ";
        } else {
            echo "[".$page."]";
            if ($this->lastPageInRange != $page)
            	echo " | ";
        }
    }
    ?>

<!-- Next page link -->
<?php
    if (isset($this->next)) {
        ?>
  <a title="next" 
	href="<?php echo $this->url(array_merge($params, array($pageName => $this->next)));
        ?>"> <img alt="next" src="<?=$this->applicationUrl()?>/public/images/ico_arrow_next.gif"> </a>
<?php
    } 
    else 
    {
    ?>
    	<img alt="previous" src="<?=$this->applicationUrl()?>/public/images/ico_arrow_next_end.gif">
    <?php		
    }
    ?>
<?php
}
?>